package com.example.happytime;
import androidx.fragment.app.Fragment;
import org.xutils.common.Callback;
import org.xutils.http.RequestParams;
import org.xutils.x;
/*
涉及到联网的Fragment的基类，将联网请求提取出来。
 */
//联网方法
public class BaseFragment extends Fragment implements Callback.CommonCallback<String> {
    public void connectNet(String url){
        //请求参数
        RequestParams params = new RequestParams(url);
        x.http().get(params,this);
    }
    @Override
    public void onSuccess(String result) {
    }
    @Override
    public void onError(Throwable ex, boolean isOnCallback) {
    }

    @Override
    public void onCancelled(CancelledException cex) {
    }
    @Override
    public void onFinished() {
    }
}